<?php

function run_application($params, &$smarty){
	if(!isset($params["name"])){
		return false;
	}
	
	$Application = $params["name"];
	$Method = (isset($params["method"])) ? $params["method"] : null;
	$Parameters = (isset($params["parameters"])) ? explode(";", $params["parameters"]) : null;
	
	$Request = new Request($Application, $Method, $Parameters);
	
	$Result = RequestHandler::interrupt($Request, true);
	
	/* if assign is set, varible {$RunApplicationResult} is set and noting is returned. 
	  Otherwise, result is returned directly to template output */
	if($params["assign"] == "1"){
		$smarty->assign("RunApplicationResult", $Result);
		return;
	}
	
	return $Result;
}

?>